<?php 
      echo $this->Html->css("chosen");
      echo $this->Html->css("dataTables");
 ?>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/customInput.jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/chosen.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/zice.custom1.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/ColVis.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/layout_table.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/manager_transfer.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine-vi.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.autotab.js"></script>

<div class="titlePage">
<h1>Quản lý hóa đơn - Hóa đơn Chuyển hàng</h1>
</div>

<div class="onecolumn">
	<div class="header">
	<span>
		<span class="ico gray window"></span>
		Tìm kiếm hóa đơn
	</span>
	</div>
	<div class="clear"></div>
	<div class="content" style="display: inline-block; width: 95%;">
		<form id="formSearch" method="post" action="">
			<div class="section">
				<label> Mã HĐ :</label>   
                <input type="text" name="idInvoice" class='validate[custom[number]]' />
            </div>
			<div class="section" style="float:left; width: 40%; border-bottom: none;">
				<label>
				Hàng hóa:
				
				</label>
				<div id="search_product">
					<select data-placeholder="Chọn sản phẩm..." class="chzn-select choose_product" tabindex="2" name="choose_product">
                          <option value=""></option> 
                          <?php foreach ($products as $item) {?>
							<option value="<?php echo $item['p']['id']; ?>"><?php echo $item['p']['name']." (".$item['u']['father']."/".$item['u']['convert']." ".$item['u']['child'].")";}?></option>
                     </select>
					
				</div>
			</div>
			<div class="section" style="float:left; width: 30%; border-bottom: none;">
				<label> Số lượng </label>   
                <div>Từ <input type="text" name="quantityStart"/></div> 
                <div>đến <input type="text" name="quantityEnd"/></div>
            </div>         
            <div class="section" style="float:left; width: 30%;border-bottom: none;">
                <label>Ngày chuyển: </label>   
                <div>Từ <input type="text"  id="dateStart" class="dateStart" name="dateStart"  /></div>
                <div>đến <input type="text"  id="dateEnd" class="dateEnd" name="dateEnd"  /></div>
            </div> 
            <input type="hidden"  id="isSearch" class="isSearch" name="isSearch" value="1"/> 
            <div class="buttonSearchInvoice" style="text-align: center;">
				<a class="uibutton" id='search_invoice'><span class="ico gray checkmark2"></span>Tìm kiếm</a>
				<div id='alert_mes'></div>
			</div>
		</form>
	</div>
</div>
<?php if($isSearch){?>
<div class="onecolumn">
	<div class="header">
	<span>
		<span class="ico gray spreadsheet"></span>
		DANH SÁCH HÓA ĐƠN
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<form>
			<div class="tableName">
				<table class="display data_table2 listTrInvoice" >
					<thead>
						<tr>
							<th><div class="th_wrapp">Hàng hóa</div></th>
							<th><div class="th_wrapp">Số lượng</div></th>
							<th><div class="th_wrapp">Ngày chuyển</div></th>
							<th><div class="th_wrapp">Quản lý</div></th>
						</tr>
					</thead>
					<tbody>
					<?php 
						foreach ($list_invoice as $item) {
					?>
							<tr class="odd gradeX TrInvoice" id="<?php  echo $item['tr']['id']; ?>">
		      					<td><?php  echo $item['p']['name'];?></td>
		      					<td class='editQuantity'><div class='old_quantity'><?php  echo $item['tr']['quantity'];?></div>
		      						<input id="<?php echo $item['tr']['id'].'_edit_q'?>" value ="<?php echo $item['tr']['quantity'];?>" class='validate[required] tmp_quantity' style="display: none"/>
		      					</td>
		      					<td><?php  echo date('d/m/Y H:i',strtotime($item['tr']['time']));?></td>
		      					<td > 
	                                <span class='btnEdit'>
	                                      <a  title="Edit" >
	                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/pencil.png" >
	                                      </a>
	                                 </span> 
	                                 <span class="tip btnDelete" >
	                                       <a title="Delete"  >
	                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/delete.png" >
	                                       </a>
	                                </span> 
	                                <span class='btnSave' style="display: none">
	                                      <a  title="Save" >
	                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/checkmark2.png" >
	                                      </a>
	                                 </span>
	                                 <span class='btnCancel' style="display: none">
	                                      <a  title="Cancel" >
	                                           <img src="<?php echo $this->webroot; ?>img/icon/color_18/cross.png" >
	                                      </a>
	                                 </span>
	                            </td>
		      					</tr><?php }?>
	     					
					</tbody>
				</table>
	            </div>
		</form>
	</div>
</div>
<?php }?>